$(document)
			.ready(
					function() {
						var clientHeight = top.document.body.clientHeight - 200;
						var clientWidth = document.body.clientWidth - 100;
						$("button").button();
						var varname = $("#varname"), varcode = $("#varcode"), parentid = $("#parentid"), remark = $("#remark"), allFields = $(
								[]).add(varname).add(varcode).add(parentid)
								.add(remark);
						$("#add").click(function() {
							$("#addinfo").dialog("open");
						});
						$("#mod").click(function() {
						});
						$("#del").click(function() {
						});
						$("#validdate").datepicker(
								$.datepicker.regional["zh-CN"]);
						$("#addinfo")
								.dialog(
										{
											autoOpen : false,
											height : clientHeight,
											width : clientWidth,
											modal : true,
											buttons : {
												"Submit" : function() {
													var bValid = true;
													allFields
															.removeClass("ui-state-error");
													bValid = bValid
															&& checkLength(
																	varname,
																	"岗位名称", 1,
																	16);
													bValid = bValid
															&& checkLength(
																	varcode,
																	"岗位编号", 6,
																	16);
													bValid = bValid
															&& checkLength(
																	parentid,
																	"上级岗位", 1,
																	16);
													if (bValid) {
														$(this).dialog("close");
													}
												},
												Cancel : function() {
													$(this).dialog("close");
												}
											}
										});
					});